package com.hyt.it.ogt.kq.service.gov.service.impl;

import com.hyt.core.base.BaseServiceImpl;
import com.hyt.it.ogt.kq.service.gov.mapper.OfficeTimeRoomParamMapper;
import com.hyt.it.ogt.kq.service.gov.model.entity.OfficeTimeRoomParam;
import com.hyt.it.ogt.kq.service.gov.service.IOfficeTimeRoomParamService;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 场次编排参数 服务实现类
 * </p>
 *
 * @author chengxh
 * @since 2021-04-13
 */
@Service
public class OfficeTimeRoomParamServiceImpl extends BaseServiceImpl<OfficeTimeRoomParamMapper, OfficeTimeRoomParam> implements IOfficeTimeRoomParamService {

    @Override
    public void initOfficeTaskTimeRoomParam(String officeId) {

        Integer count = this.lambdaQuery()
                .eq(OfficeTimeRoomParam::getOfficeId,officeId)
                .eq(OfficeTimeRoomParam::getDelFlag,false)
                .count();

        if (count <= 0) {
            baseMapper.initOfficeTaskTimeRoomParam(officeId);
        }
    }

}
